<?php

namespace App\Notifications;

use App\Models\Balance;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;

class AccountNotification extends Notification
{
    use Queueable;
    
    protected $message = '';
	
	/**
	 * @var null|Balance
	 */
    protected $account = null;

    public function __construct($message, Balance $account = null)
    {
        $this->message = $message;
        $this->account = $account;
    }
    
    public function via($notifiable)
    {
        return ['database'];
    }
	
	public function toDatabase($notification)
	{
		return [
			'message' => $this->message,
			'account' => $this->account
		];
	}
}
